﻿<Window x:Class="DaphneForms.PDNGameList"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ignore="http://www.ignore.com"
        mc:Ignorable="d ignore"
        xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"
        xmlns:service="clr-namespace:MVVMDialogs;assembly=MVVMDialog"       
        service:DialogService.IsRegisteredView="True"
        
        
        MinHeight="600" MinWidth="800" Height="768" Width="1024" WindowStartupLocation="CenterScreen"
        WindowStyle="SingleBorderWindow"
        Title="{loc:Translate Default='PDN Library'}"
        >

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <!-- PDN Data Grid Area -->
        <DataGrid Grid.Row="0" AutoGenerateColumns="True" ItemsSource="{Binding Path=GameList}"
                  CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False"
                  SelectionMode="Single" IsReadOnly="True" SelectedIndex="{Binding Path=SelectedDataRow, Mode=TwoWay}"
                  x:Name="uxDataGrid">            
            
        </DataGrid>
        
        <!-- Bottom Control Area -->
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="1*" />
            </Grid.RowDefinitions>
            
            <!-- The first line of controls -->
            <WrapPanel Grid.Row="0">
                <StackPanel Orientation="Horizontal" Margin="0,0,20,0">
                    <CheckBox Margin="5" Content="{loc:Translate Default='Use advanced filter'}" 
                              VerticalAlignment="Center" IsChecked="{Binding Path=UseLibraryFilter}" />
                    <Button Margin="5" Content="{loc:Translate Default='Setup advanced filter'}" Width="120"
                             Command="{Binding Path=SetupAdvancedFilterCommand}"/>
                    <Button Margin="5" Content="{loc:Translate Default='Clear advanced filter'}" Width="120"
                             Command="{Binding Path=ClearAdvancedFilterCommand}"/>
                </StackPanel>

                <StackPanel Orientation="Horizontal"  >
                    <TextBox Width="150" Margin="5" Text="{Binding Path=SearchedText, Mode=TwoWay}" />
                    <Button Margin="5" Content="{loc:Translate Default='Search'}" Width="90"
                            Command="{Binding Path=SearchCommand}"  />

                    <RadioButton Margin="5" GroupName="SearchType" Content="{loc:Translate Default='White player'}"
                                 VerticalAlignment="Center" IsChecked="{Binding Path=WhitePlayer, Mode=TwoWay}" />
                    <RadioButton Margin="5" GroupName="SearchType" Content="{loc:Translate Default='Black player'}"
                                 VerticalAlignment="Center" IsChecked="{Binding Path=BlackPlayer}" />
                    <RadioButton Margin="5" GroupName="SearchType" Content="{loc:Translate Default='Both'}"
                                 VerticalAlignment="Center" IsChecked="{Binding Path=BothPlayers}" />
                </StackPanel>


            </WrapPanel>

            <!-- The second line of controls -->
            <StackPanel Grid.Row="2" Orientation="Horizontal">
                <Button Margin="5" Content="{loc:Translate Default='Load game'}" Width="90"
                       Command="{Binding Path=LoadGameCommand}"  />
                <Button Margin="5" Content="{loc:Translate Default='Cancel'}" Width="90" 
                       Command="{Binding Path=CancelCommand}" />
                <Button Margin="5" Content="{loc:Translate Default='Open different PDN'}" Width="150"
                        Command="{Binding Path=LoadDifferentPDNCommand}"/>
            </StackPanel>                      
        </Grid>
    </Grid>
</Window>
